package singleton;

/**
 * 饿汉式
 * 静态内部类
 * @author wangxun
 * @version 1.0
 * @description:
 * @date 2020/11/13 9:19 上午
 */
public class HungrySingleton {

    private HungrySingleton(){

    }

    private static class SingletonFactory{
        private static HungrySingleton hungrySingleton = new HungrySingleton();
    }

    public static HungrySingleton getSingletonInstance(){
        return SingletonFactory.hungrySingleton;
    }

}
